<?php
	header("Content-Type:text/html;charset=UTF-8");
	$link = mysql_connect('localhost', 'root', 'sdata007');
	if (!$link) {
		die('连接数据出错，错误信息为: ' . mysql_error());
	}
	echo '数据库连接正常';
	mysql_close($link);
?>
<?php
// we connect to example.com and port 3307
/*$link = mysql_connect('localhost', 'root', 'sdata007');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);

// we connect to localhost at port 3307
$link = mysql_connect('127.0.0.1:3307', 'root', 'sdata007');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);*/
?>
